Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-dev-server

Package Overview
Dependencies
Maintainers
4
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-dev-server

Serves a webpack app. Updates the browser on changes.

  • 4.15.2
  • version-4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11M
decreased by-10.86%
Maintainers
4
Weekly downloads
 
Created

What is webpack-dev-server?

webpack-dev-server is a development server that provides live reloading. It is intended to be used with webpack, a module bundler. It uses webpack's watch mode and, when changes are detected, it recompiles the bundle and notifies the client to reload the page.

What are webpack-dev-server's main functionalities?

Live Reloading

Automatically reloads the page when files are changed. The 'hot' option enables Hot Module Replacement without page refresh as fallback in case of build failures.

module.exports = {
  devServer: {
    contentBase: './dist',
    hot: true
  }
};

Custom Middleware

Allows developers to add custom routes before the server starts. Useful for mocking an API or other custom server logic.

module.exports = {
  devServer: {
    before: function(app, server) {
      app.get('/some/path', function(req, res) {
        res.json({ custom: 'response' });
      });
    }
  }
};

Proxying API Requests

Redirects API calls to another server. This is useful when you have a separate API backend development server and you want to send API requests on the same domain.

module.exports = {
  devServer: {
    proxy: {
      '/api': 'http://localhost:3000'
    }
  }
};

HTTPS Support

Allows serving the webpack application over HTTPS. This is useful for testing applications that require secure connections.

module.exports = {
  devServer: {
    https: true
  }
};

Other packages similar to webpack-dev-server

FAQs

Package last updated on 20 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc